import { Body, Controller, Get, Post } from '@nestjs/common';
import { ApiTags, ApiOperation } from '@nestjs/swagger';
import { LabelService } from './label.service';

@ApiTags('标签管理')
@Controller('label')
export class LabelController {
  constructor(private readonly labelService: LabelService) {}

  @Get('query')
  @ApiOperation({ summary: '查询标签数据' })
  queryLabelList() {
    return this.labelService.queryLabelService();
  }

  @Get('list')
  @ApiOperation({ summary: '获取标签列表' })
  getLabelList() {
    return this.labelService.getLabelListService();
  }

  @Post('insert')
  @ApiOperation({ summary: '添加标签' })
  insertLabel(@Body() labelAddDto: any) {
    return this.labelService.insertLabelService(labelAddDto);
  }

  @Post('update')
  @ApiOperation({ summary: '更新标签' })
  updateLabel(@Body() labelUpdateDto: any) {
    return this.labelService.updateLabelService(labelUpdateDto);
  }

  @Post('remove')
  @ApiOperation({ summary: '删除标签' })
  removeLabel(@Body() labelDeleteDto: any) {
    return this.labelService.removeLabelService(labelDeleteDto);
  }
}
